/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sfs2x.extension.fourinarow.main;

import com.athena.objects.Player;
import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.core.SFSEventParam;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;

/**
 *
 * @author dodinhchien
 */
public class UserJoinZoneHandle extends BaseServerEventHandler{

    @Override
    public void handleServerEvent(ISFSEvent e) throws SFSException {
        User user = (User) e.getParameter(SFSEventParam.USER);
        FourinarowExtension extension = (FourinarowExtension) getParentExtension();
        Player player = new Player(user, (int) user.getSession().getProperty("mark"));
        extension.getUsersList().put(user.getId(), player);
    }
    
}
